package com.xindacloud.sms.console.system.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xindacloud.sms.console.result.Result;
import com.xindacloud.sms.console.system.dto.SmsRoleDTO;
import com.xindacloud.sms.console.system.entity.SmsRole;
import com.xindacloud.sms.console.system.service.ISmsRoleService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 * 用户角色表 前端控制器
 * </p>
 *
 * @author czc
 * @since 2019-10-08
 */
@Api(tags = {"角色模块"})
@RestController
@RequestMapping("/api/v1/sms-role")
public class SmsRoleController {

	@Autowired
	private ISmsRoleService smsRoleService;
	
	@ApiOperation(value = "角色列表",response=SmsRole.class)
	@PostMapping(value = "/getRoleList")
	public Result getSmsRoleList(@RequestBody SmsRoleDTO smsRoleDTO) {
	    return smsRoleService.getSmsRoleList(smsRoleDTO);
	}
	
	@ApiOperation(value = "保存或修改角色")
	@PostMapping(value = "/saveOrUpdateSmsRole")
	public Result saveOrUpdateSmsRole(@RequestBody SmsRoleDTO smsRoleDTO) {
	    return smsRoleService.saveOrUpdateSmsRole(smsRoleDTO);
	}
	
	@ApiOperation(value = "删除角色")
	@PostMapping(value = "/deleteSmsRole")
	public Result deleteSmsRole(@RequestBody SmsRoleDTO smsRoleDTO) {
	    return smsRoleService.deleteSmsRole(smsRoleDTO);
	}
	
}
